//求a+aa+aaa+….
#include<stdio.h>

int main(void) {
    int i, n, a, item, sum;
    printf("请输入n和a的值：\n");
    scanf("%d%d", &n, &a);
    item = 0; //item赋初值为0
    sum = 0;
    for (i = 1; i <= n; i++) { //先计算第i项，再累加
        item = item * 10 + a;
        sum = sum + item;
    }
    printf("%d\n", sum);
    return 0;
}
